package com.transsion.clouddemo.core.network

import com.google.gson.GsonBuilder
import retrofit2.Retrofit
import retrofit2.converter.gson.GsonConverterFactory

object RetrofitBuildHelper {

    const val BASE_URL = "https://test-oscloud.transsion-os.com" //Test

    private val mRetrofit: Retrofit by lazy {
        Retrofit.Builder().baseUrl(BASE_URL).client(CloudOkHttpClient.getOkHttpClient())
            .addConverterFactory(
                GsonConverterFactory.create(
                GsonBuilder().disableHtmlEscaping().create())).build()
    }

    fun <T> create(service: Class<T>): T = mRetrofit.create(service)
}